package com.esri.core.geometry;

import com.esri.core.geometry.Unit;

/* loaded from: classes.dex */
public class LinearUnit extends Unit {
    private static final long serialVersionUID = 1;

    /* loaded from: classes.dex */
    public interface Code {
        public static final int CENTIMETER = 109006;
        public static final int CHAIN = 9097;
        public static final int CHAIN_BENOIT_A = 9052;
        public static final int CHAIN_BENOIT_B = 9062;
        public static final int CHAIN_CLARKE = 9038;
        public static final int CHAIN_SEARS = 9042;
        public static final int CHAIN_SEARS_1922_TRUNC = 9301;
        public static final int CHAIN_US = 9033;
        public static final int DECIMETER = 109005;
        public static final int FATHOM = 9014;
        public static final int FOOT = 9002;
        public static final int FOOT_1865 = 9070;
        public static final int FOOT_BENOIT_A = 9051;
        public static final int FOOT_BENOIT_B = 9061;
        public static final int FOOT_BRITISH_1936 = 9095;
        public static final int FOOT_CLARKE = 9005;
        public static final int FOOT_GOLD_COAST = 9094;
        public static final int FOOT_INDIAN = 9080;
        public static final int FOOT_INDIAN_1937 = 9081;
        public static final int FOOT_INDIAN_1962 = 9082;
        public static final int FOOT_INDIAN_1975 = 9083;
        public static final int FOOT_SEARS = 9041;
        public static final int FOOT_SEARS_1922_TRUNC = 9300;
        public static final int FOOT_US = 9003;
        public static final int INCH = 109008;
        public static final int INCH_US = 109009;
        public static final int KILOMETER = 9036;
        public static final int KM150 = 109031;
        public static final int KM50 = 109030;
        public static final int LINK = 9098;
        public static final int LINK_BENOIT_A = 9053;
        public static final int LINK_BENOIT_B = 9063;
        public static final int LINK_CLARKE = 9039;
        public static final int LINK_SEARS = 9043;
        public static final int LINK_SEARS_1922_TRUNC = 9302;
        public static final int LINK_US = 9034;
        public static final int METER = 9001;
        public static final int METER_GERMAN = 9031;
        public static final int MILE_STATUTE = 9093;
        public static final int MILE_US = 9035;
        public static final int MILLIMETER = 109007;
        public static final int NAUTICAL_MILE = 9030;
        public static final int NAUTICAL_MILE_UK = 109013;
        public static final int NAUTICAL_MILE_US = 109012;
        public static final int ROD = 109010;
        public static final int ROD_US = 109011;
        public static final int YARD = 9096;
        public static final int YARD_BENOIT_A = 9050;
        public static final int YARD_BENOIT_B = 9060;
        public static final int YARD_CLARKE = 9037;
        public static final int YARD_INDIAN = 9084;
        public static final int YARD_INDIAN_1937 = 9085;
        public static final int YARD_INDIAN_1962 = 9086;
        public static final int YARD_INDIAN_1975 = 9087;
        public static final int YARD_SEARS = 9040;
        public static final int YARD_SEARS_1922_TRUNC = 9099;
        public static final int YARD_US = 109002;
    }

    static native boolean nativeEquals(int i, int i2);

    static native String nativeGetAbbreviation(int i);

    static native String nativeGetDisplayName(int i);

    static native int nativeGetID(int i);

    static native String nativeGetName(int i);

    static native String nativeGetPluralDisplayName(int i);

    public LinearUnit(int i) {
        this.mWKID = i;
    }

    @Override // com.esri.core.geometry.Unit
    public String getName() {
        if (this.mName == null) {
            this.mName = nativeGetName(this.mWKID);
        }
        return this.mName;
    }

    @Override // com.esri.core.geometry.Unit
    public String getDisplayName() {
        if (this.mDisplayName == null) {
            this.mDisplayName = nativeGetDisplayName(this.mWKID);
        }
        return this.mDisplayName;
    }

    @Override // com.esri.core.geometry.Unit
    public String getPluralDisplayName() {
        if (this.mPluralDisplayName == null) {
            this.mPluralDisplayName = nativeGetPluralDisplayName(this.mWKID);
        }
        return this.mPluralDisplayName;
    }

    @Override // com.esri.core.geometry.Unit
    public String getAbbreviation() {
        if (this.mAbbreviation == null) {
            this.mAbbreviation = nativeGetAbbreviation(this.mWKID);
        }
        return this.mAbbreviation;
    }

    @Override // com.esri.core.geometry.Unit
    public int getID() {
        if (this.mID == -1) {
            this.mID = nativeGetID(this.mWKID);
        }
        return this.mID;
    }

    @Override // com.esri.core.geometry.Unit
    public double getConversionFactor(Unit unit) {
        if (unit.getUnitType() != Unit.UnitType.LINEAR) {
            throw new GeometryException("invalid_call");
        }
        return getUnitToBaseFactor() / unit.getUnitToBaseFactor();
    }

    @Override // com.esri.core.geometry.Unit
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj instanceof LinearUnit) {
            return nativeEquals(this.mWKID, ((LinearUnit) obj).mWKID);
        }
        return false;
    }

    @Override // com.esri.core.geometry.Unit
    public Unit.UnitType getUnitType() {
        return Unit.UnitType.LINEAR;
    }

    public double convertFromMeters(double d) {
        return d / getUnitToBaseFactor();
    }

    public double convertToMeters(double d) {
        return d * getUnitToBaseFactor();
    }
}
